﻿using UnityEngine;
using System.Collections;

namespace UI
{
    public class UIUnionFightAuto : MonoBehaviour
    {
        public UISprite spr;

        public bool currentHookOn = false;
        public bool CurrentHookOn
        {
            set
            {
                if(currentHookOn != value && value)
                {
                    spr.spriteName = "UI_button_zidong_c";
                }
                else if(currentHookOn != value && !value)
                {
                    spr.spriteName = "UI_button_zidong_a";
                }
            }
        }


        void Update()
        {

            if(currentHookOn && !UnionFightData.IsOnHook)
            {
                CurrentHookOn = UnionFightData.IsOnHook;
            }
            else if(!currentHookOn && UnionFightData.IsOnHook)
            {
                CurrentHookOn = UnionFightData.IsOnHook;
            }
           
        }



    }
}
